package tech.aistar.corejava.day09;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;

/**
 * Created by 李雨昂 on 2019/7/25.
 */
public class TestPoint {
    public static void main(String[] args) throws NoSuchFieldException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        Point p = new Point();

        Class<?> c = p.getClass();

        Field f = c.getDeclaredField("x");

        System.out.println(Modifier.toString((f.getModifiers())));

        Method m = c.getDeclaredMethod("test");

        m.setAccessible(true);

        m.invoke(p,null);
    }
}
